//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.carhailing.system.controller;

import com.carhailing.common.domain.CouponActive;
import com.carhailing.common.domain.CouponUseRecord;
import com.carhailing.common.domain.CouponUserMiddle;
import com.carhailing.common.result.Result;
import com.carhailing.system.service.CouponActiveService;
import com.carhailing.system.vo.CouponVo;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping({"/coupon"})
public class CouponController {
    @Autowired
    private CouponActiveService couponActiveService;

    public CouponController() {
    }



    @GetMapping({"/CouponActiveList"})
    public List<CouponActive> CouponActiveList() {
        return this.couponActiveService.CouponActiveList();
    }

    @PostMapping("/seckillCoupon/{couponActiveId}/{couponId}")
    public Result seckillCoupon(@PathVariable Long couponActiveId,@PathVariable Long couponId) throws Exception {
        return this.couponActiveService.seckillCoupon(couponActiveId,couponId);
    }

    @PostMapping({"addCouponActice/{couponActive}"})
    public Result addCouponActive(@RequestBody CouponActive couponActive) {
        this.couponActiveService.addCouponActive(couponActive);
        return Result.success();
    }
}
